MotionTrackerCameraDevice Class

Description

MotionTrackerCameraDevice implements a camera device with metric-scale six degree-of-freedom motion tracking, which outputs InputFrame (including image, camera parameters, timestamp, 6DOF pose and tracking status).

After creation, start/stop can be invoked to start or stop data flow.

When the component is not needed anymore, call close function to close it. It shall not be used after calling close.

MotionTrackerCameraDevice outputs InputFrame from inputFrameSource. inputFrameSource shall be connected to InputFrameSink for further use. Refer to Overview .

Constructor

Create MotionTrackerCameraDevice object.

C

void easyar_MotionTrackerCameraDevice__ctor(easyar_MotionTrackerCameraDevice * * Return)

C++

MotionTrackerCameraDevice()

Java

public MotionTrackerCameraDevice()

Kotlin

constructor()

Objective-C

+ (easyar_MotionTrackerCameraDevice *) create

Swift

public convenience init()

C#

public MotionTrackerCameraDevice()

isAvailable

Check if the devices supports motion tracking. It returns True if the device supports Motion Tracking, otherwise it returns False.

C

bool easyar_MotionTrackerCameraDevice_isAvailable(void)

C++

static bool isAvailable()

Java

public static boolean isAvailable()

Kotlin

companion object fun isAvailable(): Boolean

Objective-C

+ (bool)isAvailable

Swift

public static func isAvailable() -> Bool

C#

public static bool isAvailable()

getQualityLevel

Get the quality of Motion Tracking on the device. You can decide whether to start Motion Tracking.

C

easyar_MotionTrackerCameraDeviceQualityLevel easyar_MotionTrackerCameraDevice_getQualityLevel(void)

C++

static MotionTrackerCameraDeviceQualityLevel getQualityLevel()

Java

public static int getQualityLevel()

Kotlin

companion object fun getQualityLevel(): Int

Objective-C

+ (easyar_MotionTrackerCameraDeviceQualityLevel)getQualityLevel

Swift

public static func getQualityLevel() -> MotionTrackerCameraDeviceQualityLevel

C#

public static MotionTrackerCameraDeviceQualityLevel getQualityLevel()

setFrameRateType

Sets current frame rate. Call before start. If this function is not called, the default is 30 fps.

C

bool easyar_MotionTrackerCameraDevice_setFrameRateType(easyar_MotionTrackerCameraDevice * This, easyar_MotionTrackerCameraDeviceFPS fps)

C++

bool setFrameRateType(MotionTrackerCameraDeviceFPS fps)

Java

public boolean setFrameRateType(int fps)

Kotlin

fun setFrameRateType(fps: Int): Boolean

Objective-C

- (bool)setFrameRateType:(easyar_MotionTrackerCameraDeviceFPS)fps

Swift

public func setFrameRateType(_ fps: MotionTrackerCameraDeviceFPS) -> Bool

C#

public virtual bool setFrameRateType(MotionTrackerCameraDeviceFPS fps)

setFocusMode

Sets focus mode. Call before start. If this function is not called, the default is Continousauto.

C

bool easyar_MotionTrackerCameraDevice_setFocusMode(easyar_MotionTrackerCameraDevice * This, easyar_MotionTrackerCameraDeviceFocusMode focusMode)

C++

bool setFocusMode(MotionTrackerCameraDeviceFocusMode focusMode)

Java

public boolean setFocusMode(int focusMode)

Kotlin

fun setFocusMode(focusMode: Int): Boolean

Objective-C

- (bool)setFocusMode:(easyar_MotionTrackerCameraDeviceFocusMode)focusMode

Swift

public func setFocusMode(_ focusMode: MotionTrackerCameraDeviceFocusMode) -> Bool

C#

public virtual bool setFocusMode(MotionTrackerCameraDeviceFocusMode focusMode)

setFrameResolutionType

Sets frame resolution. Call before start. If this function is not called, the default is 1280 x 960 or 1280 x 720.

C

bool easyar_MotionTrackerCameraDevice_setFrameResolutionType(easyar_MotionTrackerCameraDevice * This, easyar_MotionTrackerCameraDeviceResolution resolution)

C++

bool setFrameResolutionType(MotionTrackerCameraDeviceResolution resolution)

Java

public boolean setFrameResolutionType(int resolution)

Kotlin

fun setFrameResolutionType(resolution: Int): Boolean

Objective-C

- (bool)setFrameResolutionType:(easyar_MotionTrackerCameraDeviceResolution)resolution

Swift

public func setFrameResolutionType(_ resolution: MotionTrackerCameraDeviceResolution) -> Bool

C#

public virtual bool setFrameResolutionType(MotionTrackerCameraDeviceResolution resolution)

setTrackingMode

Sets tracking mode. Call before start. If this function is not called, the default is Anchor.

C

bool easyar_MotionTrackerCameraDevice_setTrackingMode(easyar_MotionTrackerCameraDevice * This, easyar_MotionTrackerCameraDeviceTrackingMode trackingMode)

C++

bool setTrackingMode(MotionTrackerCameraDeviceTrackingMode trackingMode)

Java

public boolean setTrackingMode(int trackingMode)

Kotlin

fun setTrackingMode(trackingMode: Int): Boolean

Objective-C

- (bool)setTrackingMode:(easyar_MotionTrackerCameraDeviceTrackingMode)trackingMode

Swift

public func setTrackingMode(_ trackingMode: MotionTrackerCameraDeviceTrackingMode) -> Bool

C#

public virtual bool setTrackingMode(MotionTrackerCameraDeviceTrackingMode trackingMode)

setBufferCapacity

Set InputFrame buffer capacity.

bufferCapacity is the capacity of InputFrame buffer. If the count of InputFrame which has been output from the device and have not been released is higher than this number, the device will not output new InputFrame until previous InputFrame has been released. This may cause screen stuck. Refer to Overview .

C

void easyar_MotionTrackerCameraDevice_setBufferCapacity(easyar_MotionTrackerCameraDevice * This, int capacity)

C++

void setBufferCapacity(int capacity)

Java

public void setBufferCapacity(int capacity)

Kotlin

fun setBufferCapacity(capacity: Int): Unit

Objective-C

- (void)setBufferCapacity:(int)capacity

Swift

public func setBufferCapacity(_ capacity: Int32) -> Void

C#

public virtual void setBufferCapacity(int capacity)

bufferCapacity

Get InputFrame buffer capacity. The default is 8.

C

int easyar_MotionTrackerCameraDevice_bufferCapacity(const easyar_MotionTrackerCameraDevice * This)

C++

int bufferCapacity()

Java

public int bufferCapacity()

Kotlin

fun bufferCapacity(): Int

Objective-C

- (int)bufferCapacity

Swift

public func bufferCapacity() -> Int32

C#

public virtual int bufferCapacity()

inputFrameSource

InputFrame output port.

C

void easyar_MotionTrackerCameraDevice_inputFrameSource(easyar_MotionTrackerCameraDevice * This, easyar_InputFrameSource * * Return)

C++

std::shared_ptr<InputFrameSource> inputFrameSource()

Java

public @Nonnull InputFrameSource inputFrameSource()

Kotlin

fun inputFrameSource(): InputFrameSource

Objective-C

- (easyar_InputFrameSource *)inputFrameSource

Swift

public func inputFrameSource() -> InputFrameSource

C#

public virtual InputFrameSource inputFrameSource()

start

Start motion tracking or resume motion tracking after pause.

Notice: Calling start after pausing will trigger device relocalization. Tracking will resume when the relocalization process succeeds.

C

bool easyar_MotionTrackerCameraDevice_start(easyar_MotionTrackerCameraDevice * This)

C++

bool start()

Java

public boolean start()

Kotlin

fun start(): Boolean

Objective-C

- (bool)start

Swift

public func start() -> Bool

C#

public virtual bool start()

stop

Pause motion tracking. Call start to trigger relocation, resume motion tracking if the relocation succeeds.

C

void easyar_MotionTrackerCameraDevice_stop(easyar_MotionTrackerCameraDevice * This)

C++

void stop()

Java

public void stop()

Kotlin

fun stop(): Unit

Objective-C

- (void)stop

Swift

public func stop() -> Void

C#

public virtual void stop()

close

Close motion tracking. The component shall not be used after calling close.

C

void easyar_MotionTrackerCameraDevice_close(easyar_MotionTrackerCameraDevice * This)

C++

void close()

Java

public void close()

Kotlin

fun close(): Unit

Objective-C

- (void)close

Swift

public func close() -> Void

C#

public virtual void close()

hitTestAgainstPointCloud

Perform hit test against the point cloud and return the nearest 3D point. The 3D point is represented by three consecutive values, representing X, Y, Z position coordinates in the world coordinate space.

For the camera image coordinate system ([0, 1]^2), x-right, y-down, and origin is at left-top corner. CameraParameters.imageCoordinatesFromScreenCoordinates can be used to convert points from screen coordinate system to camera image coordinate system.

C

void easyar_MotionTrackerCameraDevice_hitTestAgainstPointCloud(easyar_MotionTrackerCameraDevice * This, easyar_Vec2F cameraImagePoint, easyar_ListOfVec3F * * Return)

C++

std::vector<Vec3F> hitTestAgainstPointCloud(Vec2F cameraImagePoint)

Java

public java.util.@Nonnull ArrayList<@Nonnull Vec3F> hitTestAgainstPointCloud(@Nonnull Vec2F cameraImagePoint)

Kotlin

fun hitTestAgainstPointCloud(cameraImagePoint: Vec2F): ArrayList<Vec3F>

Objective-C

- (NSArray<easyar_Vec3F *> *)hitTestAgainstPointCloud:(easyar_Vec2F *)cameraImagePoint

Swift

public func hitTestAgainstPointCloud(_ cameraImagePoint: Vec2F) -> [Vec3F]

C#

public virtual List<Vec3F> hitTestAgainstPointCloud(Vec2F cameraImagePoint)

hitTestAgainstHorizontalPlane

Performs ray cast from the user’s device in the direction of given screen point.

Intersections with horizontal plane is detected in real time in the current field of view,and return the 3D point nearest to ray on horizontal plane.

For the camera image coordinate system ([0, 1]^2), x-right, y-down, and origin is at left-top corner. CameraParameters.imageCoordinatesFromScreenCoordinates can be used to convert points from screen coordinate system to camera image coordinate system.

The output point cloud coordinate on Horizontal plane is in the world coordinate system. The 3D point is represented by three consecutive values, representing X, Y, Z position coordinates in the world coordinate space.

C

void easyar_MotionTrackerCameraDevice_hitTestAgainstHorizontalPlane(easyar_MotionTrackerCameraDevice * This, easyar_Vec2F cameraImagePoint, easyar_ListOfVec3F * * Return)

C++

std::vector<Vec3F> hitTestAgainstHorizontalPlane(Vec2F cameraImagePoint)

Java

public java.util.@Nonnull ArrayList<@Nonnull Vec3F> hitTestAgainstHorizontalPlane(@Nonnull Vec2F cameraImagePoint)

Kotlin

fun hitTestAgainstHorizontalPlane(cameraImagePoint: Vec2F): ArrayList<Vec3F>

Objective-C

- (NSArray<easyar_Vec3F *> *)hitTestAgainstHorizontalPlane:(easyar_Vec2F *)cameraImagePoint

Swift

public func hitTestAgainstHorizontalPlane(_ cameraImagePoint: Vec2F) -> [Vec3F]

C#

public virtual List<Vec3F> hitTestAgainstHorizontalPlane(Vec2F cameraImagePoint)

getLocalPointsCloud

Returns the vector of point cloud coordinate. Each 3D point is represented by three consecutive values, representing X, Y, Z position coordinates in the world coordinate space.

C

void easyar_MotionTrackerCameraDevice_getLocalPointsCloud(easyar_MotionTrackerCameraDevice * This, easyar_ListOfVec3F * * Return)

C++

std::vector<Vec3F> getLocalPointsCloud()

Java

public java.util.@Nonnull ArrayList<@Nonnull Vec3F> getLocalPointsCloud()

Kotlin

fun getLocalPointsCloud(): ArrayList<Vec3F>

Objective-C

- (NSArray<easyar_Vec3F *> *)getLocalPointsCloud

Swift

public func getLocalPointsCloud() -> [Vec3F]

C#

public virtual List<Vec3F> getLocalPointsCloud()